package com.woniu.service.imp;/*
 *
 * @author   米雷
 * @Description
 * @Date:create in 16:47 2020-03-27
 *
 * */

import com.woniu.service.ComplainServcie;
import com.woniu.dao.ComplainMapper;
import com.woniu.pojo.Complain;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ComplainServiceImp implements ComplainServcie {

    @Autowired
    ComplainMapper complainMapper;
    @Override
    public String insert(Complain complain)
    {
        int i = complainMapper.insert(complain);
        if (i!=0){
            return "投诉成功";
        }else {
            return "投诉失败";
        }

    }

    @Override
    public List getCompByUserId(Long id)
    {
        return complainMapper.getByUserID(id);
    }

}
